﻿//using System;
//using System.Collections.Generic;
//using System.IO;
//using System.Text;
//using System.Xml;

//using Microsoft.VisualStudio.TestTools.UnitTesting;

//using Pibby.Core.Rss;

//namespace Pibby.Core.Tests
//{
//    [TestClass]
//    public class ItemCollectionTests
//    {
//        [TestMethod]
//        public void a()
//        {
//            ItemCollection collection = new ItemCollection();

//            using (TextReader reader = new StringReader("<item><title>a</title><pubDate>Wed, 3 Mar 2010 08:00:00 GMT</pubDate></item>"))
//            {
//                XmlReaderSettings settings = new XmlReaderSettings();
//                settings.IgnoreComments = true;
//                settings.IgnoreProcessingInstructions = true;
//                settings.IgnoreWhitespace = true;

//                using (XmlReader xmlReader = XmlTextReader.Create(reader, settings))
//                {
//                    xmlReader.Read();

//                    collection.Add(Item.Create(xmlReader));
//                }
//            }

//            using (TextReader reader = new StringReader("<item><title>b</title><pubDate>Wed, 24 Mar 2010 07:00:00 GMT</pubDate></item>"))
//            {
//                XmlReaderSettings settings = new XmlReaderSettings();
//                settings.IgnoreComments = true;
//                settings.IgnoreProcessingInstructions = true;
//                settings.IgnoreWhitespace = true;

//                using (XmlReader xmlReader = XmlTextReader.Create(reader, settings))
//                {
//                    xmlReader.Read();

//                    collection.Add(Item.Create(xmlReader));
//                }
//            }

//            using (TextReader reader = new StringReader("<item><title>c</title><pubDate>Wed, 17 Feb 2010 08:00:00 GMT</pubDate></item>"))
//            {
//                XmlReaderSettings settings = new XmlReaderSettings();
//                settings.IgnoreComments = true;
//                settings.IgnoreProcessingInstructions = true;
//                settings.IgnoreWhitespace = true;

//                using (XmlReader xmlReader = XmlTextReader.Create(reader, settings))
//                {
//                    xmlReader.Read();

//                    collection.Add(Item.Create(xmlReader));
//                }
//            }

//            using (TextReader reader = new StringReader("<item><title>d</title><pubDate>Wed, 9 Dec 2009 08:00:00 GMT</pubDate></item>"))
//            {
//                XmlReaderSettings settings = new XmlReaderSettings();
//                settings.IgnoreComments = true;
//                settings.IgnoreProcessingInstructions = true;
//                settings.IgnoreWhitespace = true;

//                using (XmlReader xmlReader = XmlTextReader.Create(reader, settings))
//                {
//                    xmlReader.Read();

//                    collection.Add(Item.Create(xmlReader));
//                }
//            }

//            Assert.AreEqual(4, collection.Count);
//            Assert.AreEqual(new DateTime(2009, 12, 9, 8, 0, 0), collection.OldestDate);
//            Assert.AreEqual(new DateTime(2010, 3, 24, 7, 0, 0), collection.MostRecentDate);
//        }
//    }
//}


